<template>
	<view class="content">
		<view class="detailedList" v-if="detailedList&&detailedList.length>0">
			<view class="detailedItem" v-for="(item,index) in detailedList" :key="item.id">
				<view class="top">
					<view class="text">
						<text v-if="item.businessType==1">余额提现</text>
						<text v-else>会员邀请奖励</text>
					</view>
					<view :class="['num',item.incomeType===1?'error':'']">
						{{item.incomeType===1?'-':'+'}}{{(item.price || 0)/100}}
					</view>
				</view>
				<view class="bottom">
					{{item.createTime}}
				</view>
			</view>
		</view>
		<view class="nullData" v-else>
			<image src="../../static/follow/follow1.png" mode="widthFix"></image>
			<view class="txt">
				您还没有余额明细哦~
			</view>
		</view>
	</view>
</template>

<script>
	import {
		queryByld
	} from '@/api/apis.js';

	import {
		mapState,
		mapMutations
	} from "vuex";
	export default {
		data() {
			return {
				detailedList: [
					// {
					// 	id: 1,
					// 	statusLabel: '提现',
					// 	num: "200.00",
					// 	status: 0,
					// 	time: '2024-04-12 12:24:48',
					// },
					// {
					// 	id: 2,
					// 	statusLabel: '奖励-会员邀请奖励',
					// 	num: "200.00",
					// 	status: 1,
					// 	time: '2024-04-12 12:24:48',
					// },
				],

			};
		},
		mounted() {
			this.onSearch()
		},
		computed: {
			...mapState("userInfo", ["Info", 'storeId']),
		},
		methods: {
			onSearch() {
				queryByld(this.Info.id).then(res => {
					console.log(res);
					// return
					this.detailedList = res.result
				})
			}

		},

	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;

		.detailedList {
			padding: 25rpx;

			.detailedItem {
				padding: 25rpx 0;
				border-bottom: 1px solid #D9D9D9;

				.top {
					margin-bottom: 25rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;
					color: #333333;

					.num {
						font-weight: bold;
					}

					.error {
						color: $uni-text-color-red;
					}
				}

				.bottom {
					font-size: 26rpx;
					margin-top: 25rpx;
					color: #767676;
					text-align: right;
				}
			}
		}

		.nullData {
			width: 100%;
			margin-top: 300rpx;

			image {
				width: 35%;
				margin: 0 auto;
				display: block;
			}

			.txt {
				text-align: center;
				color: #8C8EA0;
				font-size: 30rpx;
				margin-top: 20rpx;
			}
		}
	}
</style>